<?php
/**
 * Context.php
 *
 * @category    Madoqua
 * @package     Controller
 * @subpackage  Helper
 */

require_once 'Zend/Controller/Action/Helper/Abstract.php';

/**
 * Madoqua_Controller_Action_Helper_Context
 *
 * context switching helper
 *
 * @category    Madoqua
 * @package     Controller
 * @subpackage  Helper
 */
class Madoqua_Controller_Action_Helper_Context extends Zend_Controller_Action_Helper_Abstract
{
    /**
     * predispatch hook
     */
    public function preDispatch()
    {
        if ($this->getRequest()->getModuleName() == 'blog') {
            $ajaxContext = $this->getActionController()->getHelper('AjaxContext');
            //ajax content helper
            $action = $this->getRequest()->getActionName();
            //current action
            $ajaxContext->addActionContext($action, 'html');
            $ajaxContext->initContext();
            //set up the content helper for certain actions
        }
    }
}